using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for WriterLog
/// </summary>
public class WriterLog
{
    static string filePath;
    /// <summary>
    /// TryCatch.WriterLog l = new Artdio.Web.Class.WriterLog( Server.MapPath(@"Log/Error.log"));
    /// </summary>
    /// <param name="filePath"></param>
    public WriterLog(string Path)
    {
        filePath = Path;
    }
    public void WriterError(string ErrorPage, string ErrorMessage)
    {
        using (System.IO.StreamWriter writer = new System.IO.StreamWriter(filePath, true, System.Text.Encoding.UTF8))
        {
            writer.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "\r\n" + ErrorPage + " \r\n" + ErrorMessage + "\r\n");
            writer.Close();
        }
    }
}
